package cn.wolfcode.luowowo.article.domain;

import cn.wolfcode.luowowo.common.domain.BaseDomain;
import cn.wolfcode.luowowo.member.domain.UserInfo;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
public class Question extends BaseDomain {
    public static final int STATE_NORMAL = 0; //待审核
    public static final int STATE_DISABLE = 1; //正常

    private List<QuestionTag> quesTags = new ArrayList<>(); //该问题的标签

    private String title; //标题

    private Destination dest; //地址

    private UserInfo author; //用户

    private Date createTime; //创建时间

    private Integer state = STATE_DISABLE; //提问状态

    private long viewnum; //浏览数

    private long answernum; //回答数

    private long attentionnum; //关注数

    private QuestionContent questionContent; //内容

    private List<Answer> answers = new ArrayList<>(); //第一篇回复的最高顶的次数


    public String getStateDisplay(){
        return state == STATE_NORMAL ? "正常" : "禁用";
    }
}